package com.cskaoyan.controller.admin;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.pojo.Region;
import com.cskaoyan.service.admin.RegionService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Name : RegionController.java
 * @Time : 2021/8/13 14:44
 * @Author : Xfeng
 * @Software : IntelliJ IDEA
 */
@RestController
@RequestMapping("admin/region")
public class RegionController {

    @Autowired
    RegionService regionService;

    @RequiresPermissions(value = {"*", "admin:region:list"}, logical = Logical.OR)
    @RequestMapping("list")
    public BaseRespVo list(){
        List<Region> list = regionService.list();
        return BaseRespVo.ok(list);
    }

}
